#ifndef BARRIER_H
#define BARRIER_H

#include <QGraphicsObject>
#include <QPropertyAnimation>
#include <QTimer>
#include "Define.h"

class Barrier : public QGraphicsObject //屏障 即树类
{
    Q_OBJECT
    Q_INTERFACES( QGraphicsItem )
    Q_PROPERTY( QPointF pos READ pos WRITE setPos )
public:
    Barrier();
    QRectF	boundingRect () const; //获取外包矩形
    bool isMain;
    QPointF lastPos;//上一个位置
    void reBegin();//重新开始

public slots:
    void BeginMove();//开始移动

protected:
    void paint( QPainter* pPainter, const QStyleOptionGraphicsItem* pOption,
                QWidget* pWidget = 0 ); //重绘
private :
    static int randValue;//随机值
    QPropertyAnimation m_anim;//属性动画
};

#endif // BARRIER_H
